<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			wx.onAppRoute(function (res) {
			    let pages = getCurrentPages(),
			        view = pages[pages.length - 1];
			    if (view) {
			        wx.showShareMenu({
			            withShareTicket: true,
			            menus: ['shareAppMessage', 'shareTimeline']
			        });
			        view.onShareAppMessage = () => {
			            return {
			                title: ''
			            };
			        };
			        view.onShareTimeline = () => {
			            return {
			                title: ''
			            };
			        };
			    }
			});
			const updateManager = uni.getUpdateManager();
			updateManager.onCheckForUpdate(res=>{ if(res.hasUpdate){
				// updateManager.applyUpdate();
				uni.showToast({
					icon:'none',
					title:"检测到有新版本"
				});
			}});
			updateManager.onUpdateReady(()=>{ uni.showModal({
				title: '更新提示',
				content: '新版本已经准备好，点击确定重新启动',
				showCancel: !1,
				complete:res=>{if(res.confirm)updateManager.applyUpdate();}
			});});
			updateManager.onUpdateFailed(()=>{uni.showModal({
				title: '提示',
				content: '检查到有新版本，但是下载失败，请检查网络',
				showCancel: !1
			});});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	page {
		padding-bottom: 0;
		padding-bottom: env(safe-area-inset-bottom);
		font-size: 28rpx;
		font-family: PingFang SC, PingFang SC;
		color: #333;
		background-color: #f8f8f8;
		/* 页面背景色 */
		--bodybg: #f8f8f8;
		/* 主题色 */
		--theme: #18C954;
		/* 边框色 */
		--border: #ECECEC;
		/* 颜色4 */
		--colorfour: #F8FAE5;
	}
	.page-body {
		padding-bottom: 30rpx;
	}
	.safe-bottom {
		padding-bottom: 0;
		padding-bottom: env(safe-area-inset-bottom);
	}
	.status-bar {
		width: 100%;
		height: var(--status-bar-height);
		height: 88rpx;
	}
	.theme {
		color: var(--theme);
	}
	.auxiliary {
		color: var(--auxiliary);
	}
	.themebg {
		background: var(--theme);
	}
	.bodybg {
		background-color: #f8f8f8;
	}
	.flex {
		display: flex;
	}
	.fa {
		display: flex;
		align-items: center;
	}
	.fdc {
		flex-direction: column;
	}
	.fww {
		flex-wrap: wrap;
	}
	.flex1 {
		flex: 1;
	}
	.jcc {
		justify-content: center;
	}
	.jcsb {
		justify-content: space-between;
	}
	.jcfe {
		justify-content: flex-end;
	}
	.aic {
		align-items: center;
	}
	.aife {
		align-items: flex-end;
	}
	.bgf {
		background: #fff;
	}
	.fwb {
		font-weight: bold;
	}
	.pr {
		position: relative;
	}
	.pa {
		position: absolute;
	}
	.pf {
		position: fixed;
	}
	.oh {
		overflow: hidden;
	}
	.shadow {
		box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.1);
	}
	.tac {
		text-align: center;
	}
	.tal {
		text-align: left;
	}
	.tar {
		text-align: right;
	}
	.tdlt{
		text-decoration: line-through;
	}
	.ell1 {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.ell2 {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}
	.ell4 {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 4;
	}
	.minor {
		font-size: 24rpx;
		color: #999;
	}
	.confirm-btn {
		margin: 50rpx 34rpx 30rpx;
		width: auto;
		height: 88rpx;
		border-radius: 44rpx;
		font-size: 36rpx;
		font-weight: bold;
		color: var(--colorfour);
		background: linear-gradient( 270deg, #6CE083 0%, #3DBF63 100%);
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.nodata-box {
		position: fixed;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		display: flex;
		flex-direction: column;
		align-items: center;
		font-size: 22rpx;
		color: #aaa;
		.nodata-img {
			width: 300rpx;
			height: 300rpx;
		}
	}
	.fixed-bottom {
		position: fixed;
		bottom: 0;
		bottom: env(safe-area-inset-bottom);
		left: 0;
		right: 0;
		height: 100rpx;
		background-color: #fff;
		box-shadow: 0 -2rpx 0 0 rgba(0, 0, 0, 0.07);
	}
	.fixed-place {
		height: calc(100rpx + env(safe-area-inset-bottom));
	}
	.mt4 {
		margin-top: 4rpx;
	}
	.mt8 {
		margin-top: 8rpx;
	}
	.mt14 {
		margin-top: 14rpx;
	}
	.mt18 {
		margin-top: 18rpx;
	}
	.mt20{
		margin-top: 20rpx;
	}
	.mt24 {
		margin-top: 24rpx;
	}
	.mt26 {
		margin-top: 26rpx;
	}
	.mt28 {
		margin-top: 28rpx;
	}
	.mt30 {
		margin-top: 30rpx;
	}
	.ml28 {
		margin-left: 28rpx;
	}
	.mr22 {
		margin-right: 22rpx;
	}
	.mr24 {
		margin-right: 24rpx;
	}
	.p28 {
		padding: 28rpx;
	}
	.prow28 {
		padding: 0 28rpx;
	}
	.pcol28 {
		padding: 28rpx 0;
	}
	.bdt {
		border-top: 2rpx solid var(--border);
	}
	.bdb {
		border-bottom: 2rpx solid var(--border);
	}
	.fz20 {
		font-size: 20rpx;
	}
	.fz22 {
		font-size: 22rpx;
	}
	.fz24 {
		font-size: 24rpx;
	}
	.fz26 {
		font-size: 26rpx;
	}
	.fz30 {
		font-size: 30rpx;
	}
	.fz32 {
		font-size: 32rpx;
	}
	.fz34 {
		font-size: 34rpx;
	}
	.fz36 {
		font-size: 36rpx;
	}
	.fz38 {
		font-size: 38rpx;
	}
	.fz40 {
		font-size: 40rpx;
	}
	/* text-color */
	.tc1 {
		color: #e9363c;
	}
	.cl0 {
		color: #000;
	}
	.cl3 {
		color: #333;
	}
	.cl6 {
		color: #666;
	}
	.cl7 {
		color: #777;
	}
	.cl9 {
		color: #999;
	}
	.cla {
		color: #aaa;
	}
	.clf {
		color: #fff;
	}
</style>
